﻿@model IEnumerable<WD.Db.Contract.Log4net>

@{
    ViewBag.Title = "WD.Db.Contract.Model.Log4net_Index";
    Layout = "~/Views/Shared/_LayoutIndex.cshtml";
    int i = 0;
}

@section Script
{
    <script>
        var id = "Log4net";

        //新增按钮配置信息（弹框）
        var option_add = {
            id: id,
            title: "日志信息"

        };

        function ShowMessage(obj) {

            // msgerr({ message: $(obj).next().html() });

            ShowDialog({
                content: "<div class='form-group col-xs-12'><textarea class='form-control' style='width:100%;min-height:400px'>" + $(obj).next().html() + "</textarea></div>"
            });
        }


        $('[data-toggle="tooltip"]').tooltip();
    </script>

}

@section Style
{

}

@section ToolbarArea{

}


@section SearchArea{

}

@section MainTable{
    <table class="table">
        <thead>
            <tr>
                <th class="text-left"><span>序号</span></th>
                <th><a href="#" role="sort" data-field="Level"><span>级别</span></a></th>
                <th><a href="#" role="sort" data-field="Logger"><span>日志记录器</span></a></th>
                <th><a href="#" role="sort" data-field="Host"><span>主机</span></a></th>
                <th><a href="#" role="sort" data-field="Thread"><span>线程</span></a></th>
                <th><a href="#" role="sort" data-field="Message"><span>信息</span></a></th>
                <th><a href="#" role="sort" data-field="Exception"><span>异常</span></a></th>
                <th class="text-right"><a href="#" role="sort" data-field="CreateTime"><span>异常时间</span></a></th>



            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                i++;
                <tr>
                    <td>
                        @i
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Level)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Logger)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Host)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Thread)
                    </td>
                    <td>
                        <span class="label label-warning label-large" style="cursor: pointer" onclick="ShowMessage(this)">查看错误信息</span>
                        <span style="display: none">
                            @item.Message.Trim()
                        </span>
                    </td>
                    <td>
                        <span class="label label-danger label-large" style="cursor: pointer" onclick="ShowMessage(this)">查看异常分析信息</span>
                        <span style="display: none">
                            @item.Exception.Trim()
                        </span>
                    </td>
                    <td class="text-right">
                        @Html.DisplayFor(modelItem => item.CreateTime)
                    </td>
                </tr>
            }
        </tbody>
    </table>
}


